1. Field of the Invention
This invention relates generally to electronic gaming systems and more particularly to creating real-time shadows of complex transparent objects.
2. Description of the Background Art
Electronic gaming systems are able to produce high-quality images on display devices, typically television sets. Three-dimensional images are ever more realistic due to the increasing speed of processors. However, the capabilities of the gaming system""s processor and other hardware continue to limit the development of software to create realistic three-dimensional images in real-time.
Electronic gaming systems must be able to perform calculations fast enough to generate new images at approximately 30 or 60 frames per second. When each image contains multiple complex objects, the number of calculations can tax the capabilities of a system""s processor. Thus, it is a goal of electronic game developers to produce methods of generating images in real-time that provide high-quality images within the limits of current hardware systems.
One of the challenges facing game developers is rendering realistic shadows of transparent objects, such as glass objects, particularly those with complex shapes. Shadows of transparent objects are more complex than those of opaque objects. Shadows of opaque objects are typically uniformly dark throughout and shadows of transparent objects are typically non-uniform in shading and color. Techniques such as ray-tracing may be used to generate shadows of transparent objects; however, these techniques are computationally expensive, do not produce realistic results, and thus are not suitable for polygon-based three-dimensional graphics hardware used in electronic gaming systems.
An electronic entertainment system includes a main memory configured to store a transparent object and a receiver object, a general-purpose processor configured to execute game instructions, and a graphics processor configured to execute drawing instructions. The graphics processor, in conjunction with a vector processing unit, calculates a shadow map for the transparent object, and applies the shadow map to the receiver object.
The shadow map is calculated by determining a light vector and a light coordinate system, converting vertices of the transparent object into light coordinates, and taking a dot product of the light vector and each vertex of the transparent object in light coordinates. The shadow map is stored in a memory of the graphics processor, and then applied to the receiver object as a texture map. The graphics processor, in conjunction with the vector processing unit, preferably applies the shadow map to the receiver object using multiplicative pixel-blending techniques.
The general purpose processor determines a light vector by finding a mean direction vector from a light source to the transparent object. The mean direction vector is preferably an average of the vectors from the light source to each vertex of the transparent object. The mean direction vector may also be a vector from the light source to the center of a bounding volume of the transparent object. The light vector defines a z-axis of the light coordinate system with its origin at the light source. The general purpose processor converts the vertices of the transparent object into light coordinates using one or more conversion matrices.